EmergencyExerciseForm=Ext.extend(Ext.Window,{
    constructor:function(a){
        Ext.apply(this,a);
        this.initUIComponents();
        EmergencyExerciseForm.superclass.constructor.call(this,{
            id:'EmergencyExerciseForm',
            layout:'fit',
            title:'应急预案信息',
            items : yearGridFormPanel,
            modal:true,
            bodyStyle:'padding:2px;',
            buttonAlign:'center',
            buttons : yearGridFormButtons,
            iconCls : "menu-flowWait",
            width : 620,
            height : 375
        })
    },
    initUIComponents:function(){
        createyeargridform({
            operation:this,
            form:{
                saveUrl: __ctxPath+"/emergency/saveEmergencyExercise.do",
                items:[
                        {
                            id : "emergencyExercise.id",
                            name : "emergencyExercise.id",
                            xtype : "hidden",
                            value : this.id == null ? "": this.id
                        }, {
                            name : "emergencyExercise.years",
                            xtype : "hidden",
                            id : "emergencyExercise.years",
                            value : this.years == null ? "" : this.years
                        }, {
                            layout:'column',
                            bodyStyle:"padding:5px;",
                            border:false,
                            items:[{
                                layout:'form',
                                bodyStyle:'padding:5px;',
                                columnWidth:.5,
                                border:false,
                                items:[{
                                    xtype:'combo',
                                    fieldLabel:'所属机构',
                                    hiddenName:'emergencyExercise.institution',
                                    mode:'local',
                                    editable:false,
                                    width:146,
                                    triggerAction:'all',
                                    store:new Ext.data.ArrayStore({
                                        id:0,
                                        fields:['id','type'],
                                        data:[ [ "1", "组织部" ],
                                               [ "2", "财务部" ],
                                               [ "3", "销售部" ]]
                                    }),
                                    valueField:'type',
                                    displayField:'type',
                                    value:'销售部'
                                }]
                            },{
                                layout:'form',
                                bodyStyle:'padding:5px;',
                                columnWidth:.5,
                                border:false,
                                items:[{
                                    xtype:'textfield',
                                    fieldLabel:'预案编号<font color="red">*</font>',
                                    name:'emergencyExercise.emergencyNo',
                                    width:146,
                                    allowBlank:false,
                                    maxLength:100
                                }]
                            },{
                                layout:'form',
                                bodyStyle:'padding:5px;',
                                border:false,
                                columnWidth:.5,
                                items:[{
                                    xtype:'textfield',
                                    fieldLabel:'预案名称<font color="red">*</font>',
                                    name:'emergencyExercise.emergencyName',
                                    allowBlank:false,
                                    width:146,
                                    maxLength:200
                                }]
                            },{
                                layout:'form',
                                bodyStyle:'padding:5px;',
                                border:false,
                                columnWidth:.5,
                                items:[{
                                    xtype:'textfield',
                                    name:'emergencyExercise.coverPost',
                                    fieldLabel:'覆盖岗位',
                                    width:146,
                                    maxLength:100
                                }]
                            },{
                                layout:'form',
                                bodyStyle:'padding:5px;',
                                border:false,
                                columnWidth:.5,
                                items:[{
                                    xtype:'textfield',
                                    name:'emergencyExercise.hazardSourceName',
                                    fieldLabel:'危险源名称',
                                    width:146
                                }]
                            },{
                                layout:'form',
                                bodyStyle:'padding:5px;',
                                border:false,
                                columnWidth:.5,
                                items:[{
                                    xtype:'textfield',
                                    name:'emergencyExercise.emergencyContactMode',
                                    fieldLabel:'应急联系方式',
                                    width:146
                                }]
                            },{
                                layout:'form',
                                bodyStyle:'padding:5px;',
                                border:false,
                                columnWidth:.5,
                                items:[{
                                    xtype:'textfield',
                                    name:'emergencyExercise.rescueTeam',
                                    fieldLabel:'救援队伍（管理）',
                                    width:146
                                }]
                            }]
                        },{
                            layout:'column',
                            bodyStyle:"padding:5px;",
                            border:false,
                            items:[{
                                layout:'form',
                                bodyStyle:"padding:5px;",
                                columnWidth:1.,
                                items:[{
                                    xtype:'textarea',
                                    fieldLabel:'关键场所',
                                    name:'emergencyExercise.emergencyKeyPlace',
                                    width:448,
                                    maxLength:1000
                                }]
                            }]
                        },{
                           layout:'column',
                           bodyStyle:"padding:5px;",
                           border:false,
                           items:[{
                               layout:"form",
                               bodyStyle:"padding:5px;",
                               columnWidth:1.,
                               items:[{
                               xtype:"textarea", 
                               fieldLabel: '危险源描述', 
                               name: 'emergencyExercise.hazardDescription', 
                               width : 448,
                               maxLength:2000
                               }]
                           }]
                       },{
                           layout:'column',
                           bodyStyle:"padding:5px;",
                           border:false,
                           items:[{
                               layout:'form',
                               bodyStyle:"padding:5px;",
                               columnWidth:1.,
                               items:[{
                               xtype:'textarea',
                               fieldLabel:'备注',
                               name:'emergencyExercise.remark',
                               width:448,
                               maxLength:1000
                               }]
                           }]
                       }
               ]
            },
            loadData:{
                getUrl:__ctxPath +"/emergency/getEmergencyExercise.do",
                preName : "emergencyExercise"
            }
        });
    }
});